package com.rongke.model;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.rongke.utils.DateJsonDeserializer;
import com.rongke.utils.DateJsonSerializer;
import org.springframework.format.annotation.DateTimeFormat;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;

import java.io.Serializable;

/**
 * @CouponUser
 * @用户和优惠券中间(coupon_user)
 * @version : Ver 1.0
 */
@TableName("coupon_user")
public class CouponUser implements Serializable {
	@TableField(exist = false)
	private static final long serialVersionUID = 1L;

	/**
	 * @备注:用户和优惠券中间表id
	 * @字段:id BIGINT(19)
	 */
	@TableId(type = IdType.AUTO)
	private Long id;


	/**
	 * @备注:用户id
	 * @字段:muser_id BIGINT(19)
	 */
	private Long muserId;
	/**
	 * 备注:用户id
	 */
	@TableField(exist = false)
	private Muser muser;


	/**
	 * @备注:优惠券类型（1无门槛优惠10元2满199减20元3满299减30元4满399减40元）
	 * @字段:coupon_id BIGINT(19)
	 */
	private Long couponId;
	/**
	 * 备注:优惠券类型（1无门槛优惠10元2满199减20元3满299减30元4满399减40元）
	 */
	@TableField(exist = false)
	private Coupon coupon;


	/**
	 * @备注:数量
	 * @字段:num INT(10)
	 */
	private Integer num;


	/**
	 * @备注:有限期
	 * @字段:validity_time DATE(10)
	 */
	@JsonSerialize(using = DateJsonSerializer.class)
	@JsonDeserialize(using = DateJsonDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private java.util.Date validityTime;


	/**
	 * @备注:用户该优惠券状态（1 可用 2 废弃 3 已使用）
	 * @字段:status INT(10)
	 */
	private Integer status;


	/**
	 * @备注:优惠券来源 1 分享到朋友圈后 2 分享邀请他人注册登录所得
	 * @字段:source INT(10)
	 */
	private Integer source;


	/**
	 * @备注:获取时间
	 * @字段:gmt_datetime DATETIME(19)
	 */
	@JsonSerialize(using=DateJsonSerializer.class)
	@JsonDeserialize(using=DateJsonDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
	private java.util.Date gmtDatetime;


	public CouponUser(){
	}

	public CouponUser(
		Long id
	){
		this.id = id;
	}



	public void setId(Long id) {
		this.id = id;
	}

	public Long getId() {
		return this.id;
	}

	public void setMuserId(Long muserId) {
			this.muserId = muserId;
			}

	public Long getMuserId() {
			return this.muserId;
	}
	public void setMuser(Muser muser) {
		this.muser = muser;
	}

	public Muser getMuser() {
		return this.muser;
	}

	public void setCouponId(Long couponId) {
			this.couponId = couponId;
			}

	public Long getCouponId() {
			return this.couponId;
	}
	public void setCoupon(Coupon coupon) {
		this.coupon = coupon;
	}

	public Coupon getCoupon() {
		return this.coupon;
	}


	public void setNum(Integer num) {
		this.num = num;
	}

	public Integer getNum() {
		return this.num;
	}


	public void setValidityTime(java.util.Date validityTime) {
		this.validityTime = validityTime;
	}

	public java.util.Date getValidityTime() {
		return this.validityTime;
	}


	public void setStatus(Integer status) {
		this.status = status;
	}

	public Integer getStatus() {
		return this.status;
	}


	public void setSource(Integer source) {
		this.source = source;
	}

	public Integer getSource() {
		return this.source;
	}


	public void setGmtDatetime(java.util.Date gmtDatetime) {
		this.gmtDatetime = gmtDatetime;
	}

	public java.util.Date getGmtDatetime() {
		return this.gmtDatetime;
	}
}
